Skip to content

Conversation

@rjrudin
Copy link
Contributor

@rjrudin rjrudin commented Jan 20, 2026

This is currently an implementation detail and not exposed to a user, but doing some renaming here so it's easier for other developers to understand.

Copilot AI review requested due to automatic review settings January 20, 2026 18:21
@github-actions
Copy link

github-actions bot commented Jan 20, 2026

Copyright Validation Results
Total: 1 | Passed: 1 | Failed: 0 | Skipped: 0 | at: 2026-01-20 18:37:56 UTC | commit: 0d95e8c

✅ Valid Files

  • marklogic-client-api/src/main/java/com/marklogic/client/impl/OkHttpServices.java

✅ All files have valid copyright headers!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the retry-on-status-code feature in the OkHttpServices class to improve code clarity for developers. The changes rename variables and convert a mutable Set to an immutable constant, making the retry logic more explicit and maintainable.

Changes:

  • Renamed retry-related variables to more descriptive names (e.g., randRetryrandomForRetryDelay, minRetryminRetryAttempts, maxDelaymaxDelayForRetries)
  • Converted retryStatus Set from a mutable field initialized in constructor to an immutable constant RETRYABLE_STATUS_CODES
  • Updated all references to use the new variable names throughout the class

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

private int minRetryAttempts = DEFAULT_MIN_RETRY;

// The HTTP status codes that are retryable.
private final Set<Integer> RETRYABLE_STATUS_CODES =
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field RETRYABLE_STATUS_CODES should follow Java naming conventions for constants. It should be declared as static since it's initialized with immutable values and doesn't depend on instance state. Consider renaming to RETRYABLE_STATUS_CODES and making it private static final.

Suggested change
private final Set<Integer> RETRYABLE_STATUS_CODES =
private static final Set<Integer> RETRYABLE_STATUS_CODES =

Copilot uses AI. Check for mistakes.
}

private int calculateDelay(Random rand, int i) {
private int calculateDelay(int i) {
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter name i is ambiguous. Consider renaming it to retryAttempt or attemptNumber to clarify that it represents the current retry iteration.

Copilot uses AI. Check for mistakes.
This is currently an implementation detail and not exposed to a user, but doing some renaming here so it's easier for other developers to understand.
@rjrudin rjrudin force-pushed the feature/26654-head-transaction branch from 06bbf91 to 0d95e8c Compare January 20, 2026 18:37
@rjrudin rjrudin merged commit 4964dc7 into develop Jan 20, 2026
4 checks passed
@rjrudin rjrudin deleted the feature/26654-head-transaction branch January 20, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants